package com.huilan.hgt.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.huilan.hgt.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.lang.NonNull;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 邮件表
 * </p>
 *
 * @author ghy
 * @since 2018-11-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("T_EMAIL")
public class Email extends BaseModel<Email> {

    private static final long serialVersionUID = 1L;

    /**
     * 邮件ID
     */
    @TableId(value = "EMAIL_ID", type = IdType.AUTO)
    private Integer emailId;

    /**
     * 邮箱地址
     */
    @NotNull(message = "邮箱地址不能为空！")
    @TableField("EMAIL_ADDRESS")
    private String emailAddress;

    /**
     * 邮件主题
     */
    @TableField("EMAIL_SUBJECT")
    private String emailSubject;

    /**
     * 邮件正文
     */
    @TableField("EMAIL_CONTENT")
    private String emailContent;

    /**
     * 邮件附件
     */
    @TableField("EMAIL_ATTACHMENT")
    private String emailAttachment;

    /**
     * 连接是否一次有效（0：否，1：是）
     */
    @TableField("IS_ONCE")
    private String isOnce;


    public static final String EMAIL_ID = "EMAIL_ID";

    public static final String EMAIL_ADDRESS = "EMAIL_ADDRESS";

    public static final String EMAIL_SUBJECT = "EMAIL_SUBJECT";

    public static final String EMAIL_CONTENT = "EMAIL_CONTENT";

    public static final String EMAIL_ATTACHMENT = "EMAIL_ATTACHMENT";

    public static final String IS_ONCE = "IS_ONCE";

    @Override
    protected Serializable pkVal() {
        return this.emailId;
    }

}
